{
  "id": 1491244323262631,
  "title": "Environment | Sensor Status",
  "span": 6,
  "type": "natel-discrete-panel",
  "datasource": null,
  "targets": [
    {
      "resultFormat": "time_series",
      "intervalFactor": 1,
      "query": "SELECT \n    t, \n    groupArray((sensor, State)) AS groupArr \nFROM (\n    SELECT $timeSeries as t, \n        arrayStringConcat(path,'.') as sensor, \n        avg(sensor_status) as `State` \n    FROM \n        $table \n    WHERE \n        managed_object=$bi_id \n        and $timeFilter \n        and like(path[4],'State%')\n    GROUP BY arrayStringConcat(path,'.'), t ORDER BY t) \nGROUP BY t \nORDER BY t ASC",
      "refId": "A",
      "database": "noc",
      "tableLoading": false,
      "table": "environment",
      "dateLoading": false,
      "datetimeLoading": false,
      "dateColDataType": "date",
      "dateTimeColDataType": "ts"
    }
  ],
  "display": "timeline",
  "rowHeight": 30,
  "valueMaps": [
    {
      "text": "N/A",
      "value": "null",
      "op": "="
    },
    {
      "value": "1",
      "op": "=",
      "text": "OK"
    },
    {
      "value": "0",
      "op": "=",
      "text": "FALSE"
    }
  ],
  "mappingTypes": [
    {
      "name": "value to text",
      "value": 1
    },
    {
      "name": "range to text",
      "value": 2
    }
  ],
  "rangeMaps": [
    {
      "from": "2",
      "to": "10",
      "text": "Unknown"
    }
  ],
  "colorMaps": [
    {
      "color": "#CCC",
      "text": "N/A"
    },
    {
      "text": "OK",
      "color": "#508642"
    },
    {
      "text": "FALSE",
      "color": "#bf1b00"
    },
    {
      "text": "Unknown",
      "color": "#FADE2A"
    }
  ],
  "metricNameColor": "#000000",
  "valueTextColor": "#000000",
  "backgroundColor": "rgba(128, 128, 128, 0.1)",
  "lineColor": "rgba(128, 128, 128, 1.0)",
  "textSize": 14,
  "extendLastValue": true,
  "writeLastValue": true,
  "writeAllValues": false,
  "writeMetricNames": true,
  "showLegend": true,
  "showLegendNames": true,
  "showLegendValues": true,
  "showLegendPercent": true,
  "highlightOnMouseover": true,
  "legendSortBy": "-ms",
  "links": [],
  "showDistinctCount": false,
  "showLegendTime": false,
  "showTransitionCount": false,
  "expandFromQueryS": {{ discovery_interval }}
}